package com.wsj.service;

import java.util.List;

import com.wsj.util.exception.BusinessException;
import com.wsj.util.page.PageResultSet;
import com.wsj.web.subclass.displayBean.HomeSiteNews.AutoPlayFormExtendBean;
import com.wsj.web.subclass.displayBean.HomeSiteNews.HomeSiteIndexPageColumnBean;
import com.wsj.web.subclass.displayBean.HomeSiteNews.HomeSiteNewsExtendBean;
import com.wsj.web.subclass.displayBean.HomeSiteNews.HomeSiteNewsFormExtendBean;
import com.wsj.web.vo.homeSite.AutoPlay;
import com.wsj.web.vo.homeSite.HomeSiteNews;

public interface IHomeSiteNewsServ {
	
	boolean add(HomeSiteNews homeSiteNews)throws BusinessException;
	
	boolean delete(long id)throws BusinessException;
	boolean update(HomeSiteNews homeSiteNews)throws BusinessException;
	public void updateHits(Long homeSiteNewsId) throws BusinessException;
	HomeSiteNews getHomeSiteNewsById(long id)throws BusinessException;
	HomeSiteNews getHomeSiteNewsByName(Long homeSiteNewsClassid, String title)throws BusinessException;
	PageResultSet loadHomeSiteNewsByParam(String keyword,Integer qyId,Integer iscommend,long personalId,String title,Integer provId,Integer cityId,Integer diquId,
			int page,int pageSize, long homeSiteNewsClassid,short isDel,String  content,String createDatetimeStr)throws BusinessException;
	
	
	PageResultSet loadHomeSiteNewsByExtendBean(HomeSiteNewsFormExtendBean homeSiteNewsFormExtendBean)throws BusinessException;
	
	/**
	 * 根据栏目ID 加载资讯
	 * */
	public PageResultSet loadByClassId(Long classId,Integer page,Integer pageSize)throws BusinessException;
	/**
	 * 根据省份ID 、城市ID ,栏目ID 加载资讯
	 * */
	public PageResultSet loadByProvOrCityId(Integer qyId,Integer provId,Integer cityId,Long cid,Integer page,Integer pageSize)throws BusinessException;
	
	
	/*****
	 * GBX 加 搜索用 
	 * 条件： 标题、内容、关键字 、
	 * 附加条件：已审核、删除否、推荐、时间排序
	 * */  
	public PageResultSet loadNewsByParam(Integer type,String keyWord, Integer page,Integer pageSize) throws BusinessException;
	
	/**
	 * 主要用于首页新闻资讯的查询
	 * 基本条件：删除否、推荐、审核
	 * 条件：是否是图片新闻、资讯分类ID、前 top 条
	 * 额外条件： 是否热点 （第一条显示的要是热点）
	 * not in rdNewsId 不在热点内的资讯,null 则不排除
	 * */
	List<HomeSiteNews> getTopByclassId(Short hotspot,Integer isPic,Long newsClassId, Long[] rdNewsId, Integer top)throws BusinessException;
	
	/****
	 * 城市id,是否热点,是否图片,资讯分类,前几个
	 * @param cityId
	 * @param hotspot
	 * @param isPic
	 * @param newsClassId
	 * @param top
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getTopByclassId(Integer provId,Integer cityId,Short hotspot,Integer isPic,Long newsClassId, Integer top)throws BusinessException;
	
	
	List getTopByclassId(Short hotspot,Integer provId, Integer top)throws BusinessException;
	
	List getTopByHits(Integer top)throws BusinessException;
	
	
	public List getTopByclassId(Short hotspot,Integer id1,Integer id2,Integer id3,Integer id4, Short isPic, Integer top) throws BusinessException;
	
	
	List getTopHSiteNewsListByNewsClassId(long newsClassId, int top)throws BusinessException;

	List getTopHSiteNByOnlyNewId(long newsClassId, int top)throws BusinessException;

	List getTopBykeyword(String keyword, Integer top)throws BusinessException;

    HomeSiteNews getTopHSiteNByOrderBytime(long newsClassId,Integer id, Integer top)throws BusinessException;	
	/*****
	 * 通过广告分类名,广告描述名,图片还是文字,是否删除,前几个 ,查询广告列表
	 */
	List loadNewsByClassNameList(String name, Short picOrChar, Short isdel, Short audite, Short isCommend, Integer top)throws BusinessException;

	/*****
	 * 加载最新新闻 带有地区 ,第一个参数 城市id,第二个参数 前几个
	 * @param cityId
	 * @param top
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getTopByHits(Integer provId,Integer cityId, Integer top)throws BusinessException;

//	/*****
//	 * 
//	 * @param cityId
//	 * @param hot
//	 * @param pic
//	 * @param id
//	 * @param news_schq_fifteen
//	 * @return
//	 * @throws BusinessException
//	 */
//	List<HomeSiteNews> loadSCHQClassNewsList(Integer cityId, Short hot, Short pic, Long id, List<HomeSiteNews> news_schq_fifteen)throws BusinessException;

	/*******
	 * 获取市场行情下面的资讯列表
	 */
	List<HomeSiteNews> loadSCHQClassNewsList(Integer provId,Integer cityId, Short hot, Short pic, Long id, Integer index_top_fifteen)throws BusinessException;

	List loadHomeSiteNews(HomeSiteNewsFormExtendBean exbean)throws BusinessException;

	List loadHomeSiteNewsByProvOrCityAndClassIds(HomeSiteNewsExtendBean homeExtend)throws BusinessException;

	/*********
	 * 通过id,获取推荐的新闻
	 * @param id
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getCommendHomeSiteNewsListByClassId(Long id,int top)throws BusinessException;

	/**********
	 * 通过类目id,获取
	 * @param id
	 * @param top5
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getInterrelatedHomeSiteNewsList(String keyWords, int top5)throws BusinessException;

	/********
	 * 获取引导阅读的新闻,优先查询带图片的新闻,按时间倒序排列
	 * @param hot_news_yes
	 * @param commend_news_yes
	 * @param id
	 * @param i
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getHotCommendNewsListByClassId(Short hot_news_yes, Integer commend_news_yes, Long id, int top)throws BusinessException;

	
	/*********
	 * 获取图片新闻列表
	 * @param hot_news_no
	 * @param commend_news_yes
	 * @param id
	 * @param picNewsNum
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getTopPicNewsByclassId(Short hot_news_no, Integer commend_news_yes, Long id, int picNewsNum)throws BusinessException;

	/*********
	 * 获取前几条置顶新闻
	 * @param i
	 * @return
	 * @throws BusinessException
	 */
	List<HomeSiteNews> getTodayTopTitle(int top)throws BusinessException;
	
    /*******
     * 
     * @param week
     * @param top
     * @return
     * @throws BusinessException
     */
	List<HomeSiteNews> getCommentNewsCollectList(long classId, int top)throws BusinessException;
	
	
	/**********
	 * 通过栏目名获取该栏目下的标题列表
	 * @param columnName
	 * @param textNewsNum
	 * @param picNewsNum
	 * @param displayGridNews
	 * @return
	 * @throws BusinessException
	 */
	public HomeSiteIndexPageColumnBean getColumnNews(String columnName, int textNewsNum, int picNewsNum, boolean displayGridNews);

	/********
	 * 添加自动播放
	 * @param autoPlay
	 * @throws BusinessException
	 */
	Boolean addAutoPlay(AutoPlay autoPlay)throws BusinessException;

	/*********
	 * 通过id,获取自动播放对象
	 * @param id
	 * @return
	 * @throws BusinessException
	 */
	AutoPlay getAutoPlayById(Integer id)throws BusinessException;

	
	/********
	 * 更新自动播放新闻
	 * @param autoPlay
	 * @return
	 * @throws BusinessException
	 */
	public Boolean updateAutoPlay(AutoPlay autoPlay)throws BusinessException;

	/********
	 * 获取自动播放列表
	 * @param autoPlayFormExtendBean
	 * @return
	 * @throws BusinessException
	 */
	PageResultSet loadAutoPlayList(AutoPlayFormExtendBean autoPlayFormExtendBean)throws BusinessException;

	/******
	 * 删除自动播放新闻
	 * @param valueOf
	 * @throws BusinessException
	 */
	void delAutoPlayById(Integer valueOf)throws BusinessException;

	
	/******
	 * 获取前几个自动播放新闻
	 * @param top
	 * @return
	 * @throws BusinessException
	 */
	List<AutoPlay> getAutoPlayNewsList(int top)throws BusinessException;
	
	
	
	
	
}
